home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbordercol.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.3 KB  |  47 lines

  1. .Na "dbordercol" 
  2. .Aa
  3. .Fu
  4. Return the id of a column appearing in the most recently executed query's ORDER BY clause.
  5. .Ih "ORDER BY clause, determining the columns in"
  6. .Sy
  7. .Sf "int dbordercol(dbproc, order)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .Sp "int" "order"
  10. .Co
  11. .Bl
  12. This routine returns the id of the column that appears in a specified
  13. location within the ORDER BY clause of a SQL SELECT command.
  14. .sp
  15. For example, given the SQL statement:
  16. .SD
  17. .in +5n
  18. .ne 2
  19. select dept, name, salary from employee
  20.     order by salary, name
  21. .in -5n
  22. .ED
  23. the call
  24. .I "dbordercol(dbproc, 1)"
  25. will return 3 since the first column named in the ORDER BY clause
  26. refers to the third column in the query's \f2select-list\f1.
  27. .Bz
  28. .Pa
  29. .Pi dbproc
  30. A pointer to the DBPROCESS structure that provides the connection
  31. for a particular front-end/\*S process.  It contains all the
  32. information that \*L uses to manage communications and data between the
  33. front end and \*S.
  34. .Pi order
  35. The id that identifies the particular ORDER BY column of interest.
  36. The first column named within the ORDER BY clause is number 1.
  37. .in -.375i
  38. .Re
  39. .br
  40. The column id (based on the column's position in the \f2select-list\f1)
  41. for the column in the specified place in the ORDER BY clause.
  42. If the
  43. .I order
  44. is invalid, \f2dbordercol()\f1 returns -1.
  45. .Sa
  46. DBNUMORDERS
  47.